﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System;

public class playerPrefer : MonoBehaviour {
    public event EventHandler Fucked;
	// 玩家当前的记录
    public static  int count;
    public static int haoping=0;
    public static int guanggao = 0;
    private static string name;
    public static int subNumder;
    public GameObject good;
    public InputField input;
    //public GameObject haopingGO;

    //public static int Plyercount = 1;

	void Awake () 
    {
      // defacter();
       count= PlayerPrefs.GetInt("count");
       haoping = PlayerPrefs.GetInt("haoping");
       guanggao = PlayerPrefs.GetInt("guanggao");
       subNumder = PlayerPrefs.GetInt("subNumder");
//       print("提交的高分" + subNumder);
       if (haoping!=1)
       {
          // print("显示好评提示");
           good.SetActive(true);
       }
	}
    void defacter() 
    {
        PlayerPrefs.SetInt("haoping", 0);
        PlayerPrefs.SetInt("guanggao", 0);
        PlayerPrefs.SetInt("count", 0);
        PlayerPrefs.SetInt("subNumder",0);
    }
    public void hideGood() 
    {
        PlayerPrefs.SetInt("haoping",1);
        haoping = 1;
        good.SetActive(false);
        goodgame();
    }
    public void setName() 
    {
        if (input.text != null && input.text != string.Empty && input.text.Length <= 20 && input.text != "")
        {
            PlayerPrefs.SetInt("subNumder", playerPrefer.count);
        }

    }
    
    public void goodgame()
    {
        Fucked(this, EventArgs.Empty);
    }

    
	
	// Update is called once per frame
	
}
